﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyTruongMamNon.Man_Hinh
{
    public partial class frmHoc_Sinh : Form
    {
        public frmHoc_Sinh()
        {
            InitializeComponent();
        }

        public void HienThiHocSinh()
        {
            string sql = "select * from DMHS";
            DataTable dt = new DataTable();
            dt=Thu_Vien.ExecuteQuery(sql);
            dtgHS.DataSource=dt;
            
            txtMaHS.DataBindings.Add("text", dt, "MaHS");
            txtHo.DataBindings.Add("text", dt, "Ho");
            txtTen.DataBindings.Add("text", dt, "Ten");
            txtNgaySinh.DataBindings.Add("text", dt, "Ngaysinh");
            txtDiachi.DataBindings.Add("text", dt, "Diachi");
            cboDantoc.DataBindings.Add("text", dt, "Dantoc");
            cboPhai.DataBindings.Add("text", dt, "Gioitinh");
            cboTonGiao.DataBindings.Add("text", dt, "Tongiao");

            txtTen_Cha.DataBindings.Add("text", dt, "Hoten_cha");
            txtNghe_Cha.DataBindings.Add("text",dt,"Nghenghiep_cha");
            txtTen_Me.DataBindings.Add("text",dt,"Hoten_me");
            txtNghe_Me.DataBindings.Add("text",dt,"Nghenghiep_me");
        }

        private void frmHoc_Sinh_Load(object sender, EventArgs e)
        {
            HienThiHocSinh();
        }

     
    }
}
